package com.shop.order.service.impl;

import java.util.List;

import com.shop.order.dao.ShopCommMapper;
import com.shop.order.domain.ShopComm;
import com.shop.order.service.IShopCommService;
import com.vip.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 商品Service业务层处理
 * 
 * @author
 */
@Service
public class ShopCommServiceImpl implements IShopCommService
{
    @Autowired
    private ShopCommMapper shopCommMapper;

    /**
     * 查询商品
     * 
     * @param commId 商品主键
     * @return 商品
     */
    @Override
    public ShopComm selectShopCommByCommId(Long commId)
    {
        return shopCommMapper.selectShopCommByCommId(commId);
    }

    /**
     * 查询商品列表
     * 
     * @param shopComm 商品
     * @return 商品
     */
    @Override
    public List<ShopComm> selectShopCommList(ShopComm shopComm)
    {
        return shopCommMapper.selectShopCommList(shopComm);
    }

    /**
     * 新增商品
     * 
     * @param shopComm 商品
     * @return 结果
     */
    @Override
    public int insertShopComm(ShopComm shopComm)
    {
        shopComm.setCreateTime(DateUtils.getNowDate());
        return shopCommMapper.insertShopComm(shopComm);
    }

    /**
     * 修改商品
     * 
     * @param shopComm 商品
     * @return 结果
     */
    @Override
    public int updateShopComm(ShopComm shopComm)
    {
        shopComm.setUpdateTime(DateUtils.getNowDate());
        return shopCommMapper.updateShopComm(shopComm);
    }

    /**
     * 批量删除商品
     * 
     * @param commIds 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteShopCommByCommIds(Long[] commIds)
    {
        return shopCommMapper.deleteShopCommByCommIds(commIds);
    }

    /**
     * 删除商品信息
     * 
     * @param commId 商品主键
     * @return 结果
     */
    @Override
    public int deleteShopCommByCommId(Long commId)
    {
        return shopCommMapper.deleteShopCommByCommId(commId);
    }
}
